package org.gap.wizards.utils;

import java.awt.Point;

/**
 * Used to help store information about a particular node.
 * @author Administrator
 *
 */
public class Node
{
	private Node theParent;
	private Point thePosition;
	private int theDistance;
	private int theCost;
	
	protected Node(Node parent, Point position, int distanceFrom, int cost) {
		theParent = parent;
		thePosition = position;
		theDistance = distanceFrom;
		theCost = cost;
	}
	
	public Node parent() {		return theParent;		}
	public Point position() { 	return thePosition; 	}
	public int distance() { 	return theDistance;		}
	public int cost() { 		return theCost;		 	}
	
	@Override
	public boolean equals(Object other) {
		return (position().equals(((Node)other).position()));
	}
	
	@Override
	public String toString() {
		return "cost: " + theCost + "\tcurrent: " + thePosition;
	}
}